"""
将路径替换为自己的路径
bus /workspace/data/pascal_voc/voclist/box_1shot_bus_train.txt
car /workspace/data/pascal_voc/voclist/box_1shot_car_train.txt
cat /workspace/data/pascal_voc/voclist/box_1shot_cat_train.txt
"""
import os

old = '/workspace/data/pascal_voc/'
new = '/home/pengliang/DCNet/datasets/'

files = [f for f in os.listdir() if f.endswith('.txt')]
print(files)
for file in files:
    with open(file, 'r') as f:
        lines = f.read()
        lines = lines.replace(old, new)
    # print(lines)
    with open(file, 'w') as f:
        f.write(lines)
    # print(lines)
